package com.zbl.zblproject.pay.service;

import com.zbl.zblproject.core.entity.AdminUser;
import com.zbl.zblproject.pay.entity.PayOrder;
import com.zbl.zblproject.pay.entity.PayOrderItem;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/11/5
 */
public interface PayService {

    /**
     * 将订单信息录入数据库
     * @param user 用户
     * @param order 订单
     * @return  创建成功 或 创建失败
     */
    void createBaseOrder(AdminUser user, PayOrder order);

    /**
     * 创建批量订单
     * @param user
     * @param orders
     */
    void createBaseOrders(AdminUser user, List<PayOrder> orders);

    /**
     * 支付宝订单
     * @param order
     * @return
     */
    String alipay(AdminUser user, PayOrder order);

    /**
     * 微信订单
     * @param order
     * @return
     */
    void weixin(AdminUser user, PayOrder order);

    /**
     * 银联订单
     * @param order
     * @return
     */
    void union(AdminUser user, PayOrder order);

    PayOrder getOrderByOnlineSn(String orderSn);

    /**
     * 订单退款
     * @param order
     * @return
     */
    boolean changeOrderToRefund(PayOrder order);

    /**
     * 退款 退部分商品
     * @param list
     * @return
     */
    BigDecimal returnAlipayItems(List<PayOrderItem> list);


    String getPayOrderOnlineOrder(String orderSn);
}
